package com.example.mqttmanage.controller;/*
 * @Auther:Sadie
 * @Date:2025/10/8
 * @Description:
 * @VERSON:1.8
 */

import com.example.mqttmanage.service.MinioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/device")
public class MinioController {
    @Autowired
    private MinioService minioService;

    //上传图片到minio
    @PostMapping("/image")
    public String uploadImage(@RequestParam("file") MultipartFile file) throws Exception {
        return minioService.uploadFile(file);
    }

}
